﻿@{
    ViewBag.Title = "Monitor";
    Layout = "~/Views/Shared/_BackStageLayout.cshtml";
}
<head>
    <script language="javascript" for="DPSDK_OCX" event="OnMediaDataFirstFrameEvent(szCameraID, nCameraIDLen, nFactoryType, nPlayMode)">
	var str = (" Media Data First Frame [szCameraID=" + szCameraID + "]" + " [nCameraIDLen=" + nCameraIDLen + "]" + " [nFactoryType=" + nFactoryType + "]"
		+ " [nPlayMode=" + nPlayMode + "]");
	document.getElementById("GlobalInfo").innerText = str;
    </script>

    <script language="javascript" for="DPSDK_OCX" event="OnCorrectTalkParamEvent(nTalkType, nAudioType, nAudioBit, nSampleRate, nTransMode)">
	var str = ("Correct Talk Param [nTalkType=]" + nTalkType + " [nAudioType=]" + nAudioType + " [nAudioBit=]" + nAudioBit
		+ " [nSampleRate=]" + nSampleRate + " [nTransMode=]" + nTransMode );
	document.getElementById("GlobalInfo").innerText = str;
    </script>

    <script language="javascript" for="DPSDK_OCX" event="OnDownloadRecordProgress(szFileName,fProgress)">
	document.getElementById("textDownloadProgress").innerText = fProgress;
    </script>

    <script language="javascript" for="DPSDK_OCX" event="OnDownloadRecordComplete(szFileName)">
	document.getElementById("textDownloadProgress").innerText = 100;
	alert("下载完成!");
    </script>

    <script language="javascript" for="DPSDK_OCX" event="OnAlarmEvent(szAlarmId, szCameraId, szDeviceName, szChannelName, nAlarmType, nEventType, nLevel, nTime)">

	var str = ("OnAlarmEvent [szAlarmId=]" + szAlarmId + " [szCameraId=]" + szCameraId + "[szDeviceName=]" + szDeviceName
		+ "[szChannelName=]" + szChannelName + "[nAlarmType=]" + nAlarmType + "[nEventType=]" + nEventType + "[nLevel=]" + nLevel + "[nTime=]" + nTime);
	document.getElementById("GlobalInfo").innerText = str;

	if(8 == nAlarmType)
	{
		//alert(szChannelName);
	}
	else if((300 < nAlarmType)&&(nAlarmType < 1100))
	{
		//alert(szChannelName);
	}
	else
	{
		//alert(szCameraId);
	}
    </script>

    <script language="javascript" for="DPSDK_OCX" event="OnDevStatusEvent(szDevId, nStatus)">
	var str = "";
	switch(nStatus)
	{
		case 1:
			//alert("设备上线！" + szDevId);
			str = "设备上线！" + szDevId;
			break;
		case 2:
			//alert("设备离线！" + szDevId);
			str = "设备离线！" + szDevId;
			break;
	}
	document.getElementById("GlobalInfo").innerText = str;
    </script>

    <script language="javascript" for="DPSDK_OCX" event="OnGeneralJsonCallBack(Json)">
	var str1 = "json返回结果：";
	var str = str1 + Json;
	document.getElementById("JsonResult").innerText = str;
    </script>

    <script language="javascript" for="DPSDK_OCX" event="OnServerStatusChangeEvent(nStatus)">
	var str = "";
	switch(nStatus)
	{
		case 1:
			str = "服务上线！";
			var obj = document.getElementById("DPSDK_OCX");
			ShowCallRetInfo(obj.DPSDK_LoadDGroupInfo(), "加载组织结构");
			break;
		case 2:
			str = "服务离线！";
			break;
	}
	document.getElementById("GlobalInfo").innerText = str;
    </script>

    <script language="javascript" for="DPSDK_OCX" event="OnAsyncLoadDGroupInfoComplete(nRet, nGroupLen)">
	var str = ("AsyncLoadDGroupInfoComplete [nRet=]" + nRet + " [nGroupLen=]" + nGroupLen);
	document.getElementById("RetInfo").innerText = str;
	var obj = document.getElementById("DPSDK_OCX");
//	document.getElementById("DGroupInfo").innerText = obj.DPSDK_GetDGroupStr();
    </script>

    <script language="javascript" for="DPSDK_OCX" event="OnWndLBtnClick(nWndId, nWndNo, xPos, yPos)">
	var str = ("OnWndLBtnClick [nWndId=]" + nWndId + " [nWndNo=]" + nWndNo + " [xPos=]" + xPos + " [yPos=]" + yPos);
	document.getElementById("GlobalInfo").innerText = str;
    </script>

    <script language="javascript" for="DPSDK_OCX" event="OnWndRBtnClick(nWndId, nWndNo, xPos, yPos)">
	var str = ("OnWndRBtnClick [nWndId=]" + nWndId + " [nWndNo=]" + nWndNo + " [xPos=]" + xPos + " [yPos=]" + yPos);
	document.getElementById("GlobalInfo").innerText = str;
    </script>

    <script language="javascript" for="DPSDK_OCX" event="OnDoorStatusReportEvent(szCameraId, status, time)">
	var doorstatus = "";
	switch(status)
	{
		case 1:
			doorstatus = "开门！";
			break;
		case 0:
			doorstatus = "关门！";
			break;
		case 2:
			doorstatus = "离线！";
			break;
	}
	var str = ("DoorStatusReport [szCameraId=]" + szCameraId + " [status=]" + doorstatus + " [time=]" + time);
	document.getElementById("GlobalInfo").innerText = str;
    </script>

    <script language="javascript" for="DPSDK_OCX" event="OnNetAlarmHostStatusReportEvent(szDeviceId, nReportType, nOperationType, nStatus)">
	var strReportType = "";
	var strOperationType = "";
	var strStatus = "";
	switch(nReportType)
	{
		case 1:
			strReportType = "留守布防";
			break;
		case 2:
			strReportType = "防区旁路";
			break;
		default:
			strReportType = "未知";
			break;
	}
	switch(nOperationType)
	{
		case 1:
			strOperationType = "设备 布/撤防";
			break;
		case 2:
			strOperationType = "通道 布/撤防";
			break;
		case 3:
			strOperationType = "报警输出通道操作";
			break;
		default:
			strOperationType = "未知";
			break;
	}
	switch(nStatus)
	{
		case 1:
			strStatus = "布防/旁路";
			break;
		case 2:
			strStatus = "撤防/取消旁路";
			break;
		default:
			strStatus = "未知";
			break;
	}
	var str = ("网络报警主机状态上报 [szCameraId=]" + szDeviceId + " [ReportType=]" + strReportType + " [OperationType=]" + strOperationType + " [Status=]" + strStatus);
	document.getElementById("GlobalInfo").innerText = str;
    </script>

    <script language="javascript" for="DPSDK_OCX" event="OnVideoAlarmHostStatusReportEvent(szDeviceId, nChannelNO, nStatus)">
	var strStatus = "";
	switch(nStatus)
	{
		case 1:
			strStatus = "针对设备布防";
			break;
		case 3:
			strStatus = "针对设备撤防";
			break;
		case 4:
			strStatus = "针对通道旁路";
			break;
		case 5:
			strStatus = "针对通道取消旁路";
			break;
		case 6:
			strStatus = "针对设备在家布防";
			break;
		case 7:
			strStatus = "针对设备外出布防";
			break;
		default:
			strStatus = "未知";
			break;
	}
	var str = ("视频报警主机状态上报 [szCameraId=]" + szDeviceId + " [ChannelNO=]" + nChannelNO + " [Status=]" + strStatus);
	document.getElementById("GlobalInfo").innerText = str;
    </script>

    <script language="javascript" for="DPSDK_OCX" event="OnBayCarInfoEvent(szBayCarInfo)">

	document.getElementById("GlobalInfo").innerText = szBayCarInfo;
	alert(szBayCarInfo);

    </script>

    <script language="javascript" for="DPSDK_OCX" event="OnChannelViewInfoReportEvent(szCamearId, nDistance, nAngelH, nAzimuthH, nInclinationH)">

	var str = ("OnChannelViewInfoReportEvent [szCamearId=]" + szCamearId + " [nDistance=]" + nDistance + "[nAngelH=]" + nAngelH
		+ "[nAzimuthH=]" + nAzimuthH + "[nInclinationH=]" + nInclinationH );
	document.getElementById("GlobalInfo").innerText = str;
    </script>

    <title>实时视频</title>
    <script src="/Scripts/ocxfun.js"></script>

</head>

<div id="content" class="content">
    <div class="invoice">
        <body id="mbody" onload="init()" onunload="ButtonLogout_onclick()">
            <div class="invoice-company" style="margin-bottom:0px;">
                <div class="col-md-2">
                    <div class="form-group block1">
                        <label>IP地址</label><input type="text"  id="textIP" value="" placeholder="IP地址" class="form-control"  />
                    </div>
                    <div class="form-group block1">
                        <label>端口号</label><input type="text"  id="textPort" value="" placeholder="端口号" class="form-control"  />
                    </div>
                    <div class="form-group block1">
                        <label>用户名</label><input type="text" id="textUser" value="" placeholder="用户名" class="form-control"  />
                    </div>
                    <div class="form-group block1">
                        <label>密码</label><input type="password" id="textPassword" name="Address" value="" placeholder="密码" class="form-control" />
                    </div>
                    <div class="form-group ">
                        <button type="button" id="buttonLogin"  class="btn btn-success " onclick="return ButtonLogin_onclick()">登 录</button>
                        <button type="button" id="buttonLogout" class="btn btn-info " onclick="return ButtonLogout_onclick()">退 出</button>
                    </div>
                </div>
                <div class="col-md-1">
                    </div>
                    <div class="col-md-2">
                        <label>通道ID</label><div class="input-group block1" style="margin-bottom:15px;">
                            <input type="text" id="textCameraID" value="" placeholder="通道ID" class="form-control"  />
                            <div class="input-group-btn">
                             <label>&nbsp;</label>   <button type="button" class="btn btn-primary" id="buttonStartRealplayByHWND" onclick="return ButtonStartRealplayByHWND_onclick()">播放视频</button>
                            </div>
                        </div>
                        <label>窗口数量</label>
                        <div class="input-group block1" style="margin-bottom:15px;">
                            <select id="textWndNum" class="form-control">
                                <option value="1">1</option>
                                <option value="4">4</option>
                                <option value="6">6</option>
                                <option value="8">8</option>
                                <option value="9">9</option>
                                <option value="13">13</option>
                                <option value="16">16</option>
                                <option value="20">20</option>
                                <option value="25">25</option>
                                <option value="36">36</option>
                                <option value="64">64</option>
                                <option value="100">100</option>
                            </select>
                            <div class="input-group-btn">
                                <button type="button" class="btn btn-primary" onclick="return ButtonCreateWnd_onclick()">设 置</button>
                            </div>
                        </div>
                        <div class="form-group block1" style="display:none;">
                            <select id="selectStreamType" class="form-control">
                                <option value="1">主码流</option>
                            </select>
                        </div>
                        <div class="form-group block1" style="display:none;" >
                            <select id="selectMediaType" class="form-control">
                                <option value="1">视频</option>
                                <option value="2">音频</option>
                                <option value="3">视频 + 音频</option>
                            </select>
                        </div>
                        <div class="form-group block1" style="display:none;">
                            <select id="selectTransType" class="form-control">
                                <option value="1">TCP</option>
                            </select>
                        </div>
                       
                        
                    </div>
               

                    <div style="width: 90%;height: 30px;overflow: auto;" id="RetInfo">

                    </div>
                    <div style="width:700px;height:700px;">
                        <object id="DPSDK_OCX" classid="CLSID:D3E383B6-765D-448D-9476-DFD8B499926D" style="width: 100%; height: 80%" codebase="DpsdkOcx.cab#version=1.0.0.0"></object>
                    </div>
                </div>

            
            <div style="width: 90%;height: 30px;overflow: auto; display:none;" id="GlobalInfo">

            </div>
            </div></body>
    </div>
</div>    
@section footer {
    <script>
        var xmldoc = "";
        function GetGroupInfo()
        {
            ButtonLoadDGroupInfo_onclick();
            var obj = document.getElementById("DPSDK_OCX");
            var xml= obj.DPSDK_GetDGroupStr();
            if(xml!="")
            {
                xmldoc = client.XML.loadxml(xml);
            }
        }



        

    </script>
  
}





